package unclassified.ccb;

public class RemoveListGapNode {
    public ListNode deleteListNode(ListNode head) {

        ListNode dummy = head;
        while(head != null && head.next != null) {
            head.next = head.next.next;
            head = head.next;
        }
        return dummy;
    }

    public static void main(String[] args) {
        RemoveListGapNode rgn = new RemoveListGapNode();
        ListNode l = new ListNode(1);
        ListNode curry = l;
        for (int i = 2; i < 5; i++) {
            l.next = new ListNode(i);
            l = l.next;
        }
        rgn.deleteListNode(curry);
    }
    private static class ListNode {
        int val;
        ListNode next;
        ListNode(int x) { val = x; }
    }
}
